package interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;


/**
 * Created by ykj on 16/3/1.
 */
public class AdminLoginInterceptor implements Interceptor {
    public void intercept(Invocation inv) {
        if(inv.getController().getSession().getAttribute("admin")!=null){
            inv.invoke();
        }else{
            inv.getController().redirect("/admin/login");
        }
    }
}
